package com.winbomb.simulife.impl;

import com.winbomb.simulife.Master;
import com.winbomb.simulife.World;
import com.winbomb.simulife.base.IChoice;
import com.winbomb.simulife.base.IEvent;
import com.winbomb.simulife.framework.Game;

public abstract class BaseEvent implements IEvent {

	protected World world;
	protected Master master;
	protected int dueTime;

	public BaseEvent(World world) {
		this.world = world;
		this.master = world.getMaster();
	}

	@Override
	public int getDueTime() {
		return dueTime;
	}

	@Override
	public void setDueTime(int dueTime) {
		this.dueTime = dueTime;
	}

	@Override
	public IChoice[] getChoices() {

		// 简单地跳转到下一个事件，如果事件有处理逻辑，需要复写这个方法
		return new IChoice[] { new IChoice() {

			@Override
			public String getChoiceName() {
				return "确定";
			}

			@Override
			public void doChoice(Game game) {
				game.getWorld().nextEvent();
			}
		} };
	}
}
